package com.imooc.springcloud;

import com.imooc.springcloud.rules.MyRule;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Configuration;

/**
 * 全局负载均衡策略,只需要在configuration上下文声明一个bean
 * @author caryguan
 * @version V1.0
 * @Package com.imooc.springcloud
 * @date 2020/10/20 18:44
 */

@Configuration
// @RibbonClient(name = "eureka-client",configuration = com.netflix.loadbalancer.RandomRule.class)
@RibbonClient(name = "eureka-client",configuration = MyRule.class)
public class RibbonConfiguration {

    // @Bean
    // public IRule defaultLBStrategy(){
    //     return new RandomRule();
    // }
}